
Ext.define('web.common.misc.Msg', { 
	config : {
		title : '',
		msg : '',
		width : 300,
		icon : '',
		buttons : Ext.MessageBox.OK,
		fn : ''
	},
	constructor : function(cfg){
		this.initConfig(cfg);
	},
	showInfoMsg : function(){
		var me = this;
		if(Ext.isEmpty(me.getTitle()))
			me.setTitle('Info');
		me.setIcon(Ext.MessageBox.INFO);
		me.show();
	},
	showWarningMsg : function(){	
		var me = this;
		if(Ext.isEmpty(me.getTitle()))
			me.setTitle('Warning');
		me.setIcon(Ext.MessageBox.WARNING);
		me.show();
	},
	showErrorMsg : function(){	
		var me = this;
		if(Ext.isEmpty(me.getTitle()))
			me.setTitle('Error');
		me.setIcon(Ext.MessageBox.ERROR);
		me.show();
	},
	show : function(){
		var me = this;
		Ext.Msg.show({
			title : me.getTitle(),
			msg : me.getMsg(),
			width : me.getWidth(),
			icon : me.getIcon(),
			buttons : me.getButtons(),
			fn : me.getFn()
		});
	}
});
